package com.sise.wangzhan.main;

import com.sise.wangzhan.client.PersonClient;
import feign.Feign;
import feign.gson.GsonEncoder;

/**
 * @Classname EncoderTest
 * @Description TODO
 * @Date 2020/4/8 21:32
 * @Created by wangzhan
 */
public class EncoderTest {
    public static void main(String[] args) {

        PersonClient personClient = Feign.builder()
                //编码器：将请求对象转换成JSON字符串
                .encoder(new GsonEncoder())
                .target(PersonClient.class, "http://localhost:8080/");
        PersonClient.Person person = new PersonClient.Person();
        person.setPerson_id(1);
        person.setP_name("zhazhawang");
        person.setAge(50);
        person.setMessage("");
        String response = personClient.createPerson(person);
        System.out.println(response);
    }
}
